package com.budwk.app.sqfwV2.service.propagandaScreening;

import cn.hutool.json.JSONUtil;
import com.budwk.app.sqfw.models.Sqfw_formSummary_new;
import com.budwk.app.sqfwDoc.bo.ExcelCreateConfig;
import com.budwk.app.sqfwDoc.codeGenerator.pdfGenerate.AbstractCustomerPdfCreateField;
import com.budwk.app.sqfwDoc.codeGeneratorV2.config.ExcelGeneratorConfig;
import com.budwk.app.sqfwDoc.codeGeneratorV2.excelService.CompleteFlowExcelService;
import com.budwk.app.sqfwDoc.codeGeneratorV2.fileParam.CompleteFlowExcelParamForController;
import com.budwk.app.sqfwDoc.codeGeneratorV2.fileParam.ExcelGenerateParam;
import com.budwk.app.sqfwDoc.codeGeneratorV2.fileParam.ExcelRowDataParam;
import com.budwk.app.sqfwV2.dto.PropagandaScreeningDTO;
import com.budwk.app.sqfwV2.enums.PatrolAndVisitEnum;
import com.budwk.app.sqfwV2.enums.PropagandaScreeningEnum;
import com.budwk.app.sqfwV2.generator.patrolAndVisit.PatrolAndVisitExcelV2Generator;
import com.budwk.app.sqfwV2.generator.propagandaScreening.PropagandaScreeningExcelGenerator;
import org.nutz.ioc.loader.annotation.IocBean;

import java.util.ArrayList;
import java.util.List;

@IocBean
public class PropagandaScreeningExcelService extends CompleteFlowExcelService {


    @Override
    protected void customerPopularExcelGenerateParam(ExcelGenerateParam excelGenerateParam) {

    }

    @Override
    public List<ExcelGeneratorConfig> getExcelGeneratorConfig(List<ExcelCreateConfig> excelCreateConfigList) {
        List<ExcelGeneratorConfig> excelGeneratorConfigs=new ArrayList<>();
        ExcelGeneratorConfig generatorConfig=new ExcelGeneratorConfig();
        String code = excelCreateConfigList.get(0).getFileIdentity();
        generatorConfig.setExcelGenerator(new PropagandaScreeningExcelGenerator(PropagandaScreeningEnum.getPdfTemplat(Integer.parseInt(code))));
        generatorConfig.setExcelCreateConfig(excelCreateConfigList.get(0));
        excelGeneratorConfigs.add(generatorConfig);
        return excelGeneratorConfigs;
    }

    @Override
    public AbstractCustomerPdfCreateField getAbstractCustomerField(String jsonStr) {
        return JSONUtil.toBean(jsonStr, PropagandaScreeningDTO.class);
    }
    @Override
    protected List<ExcelRowDataParam> getExcelRowData(CompleteFlowExcelParamForController paramForController) {

        return transformFormSummaryToExcelRowData(new ArrayList<Sqfw_formSummary_new>());
    }


}